<template>
    <div>
        <p style="color:orange;font-size: 14px;">
            <i class="el-icon-s-promotion"></i>
            地产列表
        </p>
        <!-- 卡片 -->
        <CateList :list='cateList'></CateList>
    </div>
</template>
<script>
import { getCateList } from '@/api/category'
export default {
    data() {
        return {
            cateList: [],
            // 类型id
            TypeId: '',
            router: ''
        }
    },
    created() {
        this.getCateType()
        // this.data()
    },
    methods: {
        async getCateType() {
            this.TypeId = this.$route.params.id
            const res = await getCateList()
            // console.log("分类列表的数据", res.data);
            res.data.forEach(item => {
                // console.log('点击的id', item);
                if (item.category) {
                    if (item.category.id == this.TypeId) {
                        this.cateList.push(item)
                    }
                }else{
                    this.cateList.push(item)
                }
            })
        },
        // 数据
        // data() {
        //     this.router = this.$route.path.split('/')[1]
        //     console.log(11122, this.router);
        //     this.cateList.path = this.router
        // }
    }
}
</script>
<style>

</style>